<template>
  <div style="height: 100%;width: 100%">
    <returnActionList></returnActionList>
    <div style="width: 80%" class="fd itemcenter fs25 c-g">
      <div class="fr between m-top30" style="width: 50%">
        <div>管理员</div>
        <el-button type="success" plain  style="width: 150px" @click="cutMassage(r='1')">切换到管理员</el-button>
      </div>
      <div  class="fr between m-top30" style="width: 50%">
        <div>财务</div>
        <el-button type="success" plain  style="width: 150px" @click="cutMassage(r='2')">切换到财务</el-button>
      </div>
      <div  class="fr between m-top30" style="width: 50%">
        <div>员工</div>
        <el-button type="success" plain  style="width: 150px" @click="cutMassage(r='3')">切换到员工</el-button>
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    name: "RoleMassage",
    data(){
      return{

      }
    },
    methods:{
      cutMassage:function (r) {
        console.log(r)
        console.log('messageUser',this.$store.getters.getMassageNum)
        this.$confirm('是否切换权限', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.$store.commit('setMassageNum', r);
          console.log('messageUser',this.$store.getters.getMassageNum)
          this.$message({
            type: 'success',
            message: '切换成功!'
          });
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消'
          });
        });
      }
    }
  }
</script>

<style scoped>

</style>
